<script>
	export default {
		onLaunch: function() {
			uni.onPushMessage((content) => {
				let message = JSON.parse(content);
				uni.createPushMessage({
					content: message.data.content
				});
				
				let orderAudio = uni.createInnerAudioContext();
				orderAudio.autoplay = true;
				orderAudio.src = '/static/audio/new_order.mp3';
				orderAudio.onPlay(() => {
					//console.log('开始播放新订单语音');
				});
				orderAudio.onError(res => {
					//console.log('播放新订单语音错误');
					//console.log(res);
				});
			});
			
			plus.navigator.closeSplashscreen();
			
		},
		onShow: function() {
			console.log('App Show');
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	@import './common/uni.css';
	@import 'common/lig.css';
	@import './util/font.css';
	@import '@/uni_modules/uni-scss/index.scss';
	/* #ifndef APP-NVUE */
	@import '@/static/customicons.css';
	// 设置整个项目的背景色
	page {
		background-color: #f5f5f5;
	}

	/* #endif */
</style>
